"""
系统用户的登录页面
"""

from selenium.webdriver.common.by import By

from pom.base import BaseDriver


class LoginPage(BaseDriver):

    _login_name = By.XPATH, '//input[@placeholder="请输入登录账号"]'
    _login_pass = By.XPATH,'//input[@placeholder="请输入密码"]'
    _login_btn = By.XPATH,'//button[@class = "el-button login-btn el-button--primary el-button--medium"]'

    def __init__(self, driver):
        super(LoginPage, self).__init__(driver)
    @property
    def loginname(self):
        """
        用户名
        :return:
        """
        return self.driver.find_element(*self._login_name)

    @property
    def loginpass(self):
        """
        密码
        :return:
        """
        return self.driver.find_element(*self._login_pass)

    @property
    def loginbtn(self):
        """
        登录按钮
        :return:
        """
        return self.driver.find_element(*self._login_btn)